﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CarLoanSystem.Entity;

namespace CarLoanSystem
{
    public partial class frmMainLoanEmployee : Form
    {
        private EmployeeItem empItem;
        public frmMainLoanEmployee()
        {
            InitializeComponent();
        }

        public frmMainLoanEmployee(EmployeeItem item)
        {
            this.empItem = item;
            InitializeComponent();
            this.panelLoan.Hide();
            this.panelAppointment.Hide();
            this.panelMember.Hide();
        }

        private void btnLoan_Click(object sender, EventArgs e)
        {
            this.panelLoan.setEmployee(this.empItem);
            this.panelLoan.setMode("view");
            this.panelLoan.Show();
            this.panelLoan.refreshGridview();
            this.panelAppointment.Hide();
            this.panelMember.Hide();
            this.panelMain.Hide();
        }

        private void btnConfrem_Click(object sender, EventArgs e)
        {
            this.panelLoan.setEmployee(empItem);
            this.panelLoan.setMode("approve");
            this.panelLoan.Show();
            this.panelLoan.refreshGridview();
            this.panelAppointment.Hide();
            this.panelMember.Hide();
            this.panelMain.Hide();
        }

        private void btnAppoinment_Click(object sender, EventArgs e)
        {
            this.panelLoan.Hide();
            this.panelAppointment.setEmployee(empItem);
            this.panelAppointment.Show();
            this.panelAppointment.refreshGridview();
            this.panelMember.Hide();
            this.panelMain.Hide();
        }

        private void btnCustumer_Click(object sender, EventArgs e)
        {
            this.panelLoan.Hide();
            this.panelAppointment.Hide();
            this.panelMember.setEmployee(empItem);
            this.panelMember.setMode("View");
            this.panelMember.Show();
            this.panelMain.Hide();
        }

        private void btnMain_Click(object sender, EventArgs e)
        {
            this.panelLoan.Hide();
            this.panelAppointment.Hide();
            this.panelMember.Hide();
            this.panelMain.Show();
        }

        private void btnAlerts_Click(object sender, EventArgs e)
        {
            this.panelLoan.Hide();
            this.panelAppointment.Hide();
            this.panelMember.Hide();
            this.panelMain.Hide();
            this.panelAlertsMessage.setEmployee(empItem);
            this.panelAlertsMessage.Show();
        }
    }
}
